package WrittenExamination;

import java.util.Scanner;

public class day3 {
    /**
     * 连续最长数字串
     *
     * @param
     */
    public static String func(String str){
        int max = 0;
        int length = 0;
        int end = 0;//用于指示字符串末尾
        char[] ch = str.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if(str.charAt(i) >='0' && str.charAt(i) <= '9'){
                length++;
                if(length>max){
                    max = length;
                    end = i;//换max值时，end下标需要跟过来
                }
            }else{
                length = 0;
            }
        }
        return str.substring(end-max+1,end+1);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        System.out.println(func(s1));
    }
}
